<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
		<title>我的</title>
		<link rel="stylesheet" href="css/base.css" />
		<link rel="stylesheet" href="css/all.css" />
		<link rel="stylesheet" href="css/personage.css" />
		<link rel="stylesheet" href="css/footer.css" />
	</head>

	<body>
		<div class="layer">
			<div class="heads">
				<h1 class="titles">个人中心</h1>
			</div>
			<div class="middle">
				<div class="neck">
					<div class="portrait">
						<img src="img/500619593.png" alt="" class="portraits">
					</div>
					<a href="" class="name">陌上浅笑</a>
				</div>
				<ul class="listboxs">
					<li class="listbox">
						<div onclick="location.href='./account-capital.html'">
							<img src="img/zijin.png" alt="" class="personage-icon">
							<span>账户资金</span>
							<img src="img/jiantou.png" alt="" class="arrow">
						</div>
					</li>
					<li>
						<div onclick="location.href='./bank-card.html'">
							<div class="listbox">
								<img src="img/yinhangka.png" alt="" class="personage-icon">
								<span>银行卡</span>
								<img src="img/jiantou.png" alt="" class="arrow">
							</div>
						</div>
					</li>
					<li class="listbox">
						<div onclick="location.href='./real-name.html'">
							<img src="img/renzheng.png" alt="" class="personage-icon">
							<span>实名认证</span>
							<img src="img/jiantou.png" alt="" class="arrow">
						</div>
					</li>
					<li class="listbox">
						<div onclick="location.href='./sent-task.html'">
							<img src="img/guanli.png" alt="" class="personage-icon">
							<span>任务管理</span>
							<img src="img/jiantou.png" alt="" class="arrow">
						</div>
					</li>
					<li class="listbox">
						<div onclick="location.href='./feedback.html'">
							<img src="img/fankui.png" alt="" class="personage-icon">
							<span>意见反馈</span>
							<img src="img/jiantou.png" alt="" class="arrow">
						</div>
					</li>
					<li class="listbox">
						<div onclick="location.href='./set.html'">
							<img src="img/shezhi.png" alt="" class="personage-icon">
							<span>设置</span>
							<img src="img/jiantou.png" alt="" class="arrow">
						</div>
					</li>
				</ul>
			</div>
			<div class="footer">
				<ul class="flex" id="bottom">
					<li class="footer-one">
						<a href="home-page.html">
							<img src="img/shouye.png" alt="" />
							<i> 首页</i>
						</a>
					</li>
					<li class="footer-five">
						<a href="publish.html">
							<img src="img/fabu.png" alt="" />
							<i>发布</i>
						</a>
					</li>
					<li class="footer-one">
						<a href="">
							<img src="img/wode.png" alt="" />
							<i>我的</i>
						</a>
					</li>
				</ul>
			</div>
		</div>
		<script src="js/jquery.js"></script>
		<script src="js/all.js"></script>
		<script src="js/x_rem.js"></script>
		<script>
			(() => {

				$.ajax({
					type: "post",
					url: Url + "/user/isLog",
					xhrFields: {
						withCredentials: true
					},
					data: {

					},
					success: ((data) => {
						console.log(data);
						if(data) {
							popup("请先登录");
							location.href = "login.html";
						}
					}),
					error: ((err) => {
						console.log(err);
					})
				});

				$.ajax({
					type: "post",
					url: Url + "/user/getUsers",
					xhrFields: {
						withCredentials: true
					},
					data: {

					},
					success: ((data) => {
						console.log(data);
						if(data.portrait != null) { //如果头像不等于空的话
							$(".portraits").prop("src", data.portrait); //就把头像换到页面上去

							$(".name").text(data.nickName);
						}

					}),
					error: ((err) => {
						console.log(err);
					})
				});

				//放在主页面  点击两次退出APP 点击一次退出
				document.addEventListener('plusready', function(a) {
					var first = null;
					plus.key.addEventListener('backbutton', function() {
						//首次按键，提示‘再按一次退出应用’
						if(!first) {
							first = new Date().getTime();

							//document.write('再按一次退出应用');//用自定义toast提示最好
							$("body").append('<div class="tishi">双击退出</div>');
							$(".tishi").css({
								"width": "2.7rem",
								"display": "flex",
								"position": "absolute",
								"font-size": ".24rem",
								"background": "rgba(63,63,63,0.8)",
								"height": ".5rem",
								"top": "83vh",
								"left": "33vw",
								"border-radius": "32px",
								"color": "#ffffff",
								"padding": ".08rem 0px 0px .9rem",
								"display": "flex"
							});

							setTimeout(function() {
								first = null;
								$(".tishi").fadeOut(2000, function() {
									$(".tishi").remove();
								});
							}, 1000);
						} else {
							if(new Date().getTime() - first < 1000) {
								plus.runtime.quit();
							}
						}
					}, false);
				});

			})()
		</script>
	</body>

</html>